/**
 * @file PacketSniffer.h
 * @brief 
 * 
 *      封装抽象了一些监听器和解析器，组成抓包器
 * 
 * @author Zyan (zyishere2001@qq.com)
 * @version 1.0
 * @date 2022-05-07
 * 
 * @copyright Copyright (c) 2022  Zyanishere2001
 * 
 * @par 修改日志:
 * V1.0_0507 基础框架和接口（start stop）
 * V1.1_0507 构造函数char*安全化
 */
#ifndef _PACKET_SNIFFER
#define _PACKET_SNIFFER

#include "PacketListener.h"
#include "Logger.h"
#include "PacketResolver.h"

#define WORKER_NUM  2 //能同时处理的包的个数
using namespace hv;

class PacketSniffer:public PacketListener, public PacketResolver {
public:
    PacketSniffer(const char* ip, SafeQueue<Packet_t>& queue);
    ~PacketSniffer();
    
    void start();
    void stop();


private:
    EventLoopThread workerThread;
    const EventLoopPtr& worker = workerThread.loop();
};

#endif